# import os
# print("getcwd == ", os.getcwd())  # 获取当前目录

# import sys
# print("argv == ", sys.argv)      # 我当前是谁
# print(sys.platform)  # 平台
# print(sys.path)  # 到这些路径下找包

# import time
# start=time.time()
# for i in range(1000000):
#     i+=1
# end=time.time()
# print(end - start)

# print("start")
# time.sleep(1)
# print("end")

# print(time.localtime())

# import math
# print(math.pi)

# 8.2

# import random
# print(random.randrange(100, 200, 2))

# n=list(range(1,100))
# print(n)
# random.shuffle(n)
# print(n)

# # - search(pattern,string)  在字符串中寻找模式
# # - match(pattern,string)   在字符串开始处匹配模式
# # - split(pattern,string)   根据模式分割字符串
# # - findall(pattern,string) 列表形式返回匹配项
# # - compile(pattern)        创建模式对象

# import re
# x="我是杨青。我在学Python。这个很简单。好学"
# print(re.search("杨青",x ))
# print(re.match("我", x))
# print(re.split("。", x))
# print(re.findall("[a-zA-Z]", x))

# r=re.compile("。")
# print(r.search(x))
# print(r.match(x))
# print(r.split(x))
# print(r.findall(x))


# 8.4
# import cv2

# img=cv2.imread("src\chapter8\lenaColor.bmp")
# face=cv2.CascadeClassifier(cv2.data.haarcascades+'haarcascade_frontalface_default.xml')
# faces=face.detectMultiScale(img,scaleFactor=1.3,minNeighbors=3)

# for (x,y,w,h) in faces:
#         img=cv2.rectangle(img,(x,y),(x+w,y+h),(120,80,255),9)
# # bgr模式，b蓝色。g绿色，r红色
# cv2.imshow("show", img)
# cv2.waitKey(0)
# cv2.destroyAllWindows()

# 8.5
def t():
    if __name__ == '__main__':
        print("自我调用")
    else:
        print("别人在调用")

# t()